package hhm.javamode.composite.duck;

/**
 * Created by Administrator on 2017/1/23.
 */
public class TestCount {


    public  static  void main (String args[]){

        Quackable mallQuackable= new QuackCounter(new MallardDuck());//定义绿头鸭
        Quackable reQuackable= new QuackCounter(new  RedheadDuck());//定义红头鸭
        Quackable duckcall= new  QuackCounter(new DuckCall());//定义鸭鸣器
        Quackable rubber= new QuackCounter(new RubberDuck());//定义橡皮鸭


        mallQuackable.quack();
        

        System.out.println( "The Duck quacked " + QuackCounter.getQuacks()+" times");
    }
}
